<template>
  <div class="personal-main">
    <div class="personal-money">
      <h3><i>投资记录</i></h3>

      <div class="personal-moneylist" style="margin-top: 40px;">
        <div class="pmain-contitle">
          <span class="pmain-title1 fb" style="width: 200px;">
            投资编号
          </span>
          <span class="pmain-title2 fb" style="width: 70px;">
            标的ID
          </span>
          <span class="pmain-title3 fb" style="width: 100px;">
            投资金额
          </span>
          <span class="pmain-title4 fb" style="width: 100px;">
            年利率
          </span>
          <span class="pmain-title5 fb" style="width: 150px;">
            投资时间
          </span>
          <span class="pmain-title6 fb" style="width: 100px;">
            预期收益
          </span>
          <span class="pmain-title7 fb" style="width: 100px;">
            实际收益
          </span>
        </div>
        <ul>
          <li
              v-for="lendItem in lendItems"
              :key="lendItem.id"
              style="width:100%"
          >
            <span class="pmain-title1 pmain-height" style="width: 200px;">
              {{ lendItem.lendItemNo }}
            </span>
            <span class="pmain-title2 pmain-height" style="width: 70px;">
              {{ lendItem.lendId }}
            </span>
            <span class="pmain-title3 pmain-height" style="width: 100px;">
              {{ lendItem.investAmount }}
            </span>
            <span class="pmain-title4 pmain-height" style="width: 100px;">
              {{ lendItem.lendYearRate }}
            </span>
            <span class="pmain-title5 pmain-height" style="width: 150px;">
              {{ lendItem.investTime }}
            </span>
            <span class="pmain-title6 pmain-height" style="width: 100px;">
              {{ lendItem.expectAmount }}
            </span>
            <span class="pmain-title7 pmain-height" style="width: 100px;">
              {{ lendItem.realAmount }}
            </span>
            <span
                :title="lendItem.memo"
                class="pmain-title1 pmain-height"
                style="width: 500px; overflow: hidden;"
            >
              {{ lendItem.memo }}
            </span>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<style  scoped>
    span{
    text-align:center;
  }
</style>
<script>
import cookie from 'js-cookie'
export default {
  data() {
    return {
      lendItems: [],
      userInfo:cookie.get("userinfo")
    }
  },

  created() {
    this.fetchLendItem();
    console.log(userinf)
  },

  methods: {
    fetchLendItem() {
      this.$axios.$get('/site/lendItem/select').then((response) => {
        this.lendItems = response.data.lendItems;
      })
    },
  },
}
</script>

<style scoped>

</style>